package com.yonyou.syc.mapper;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

@Mapper
public interface SycExpenseCardMapper {
    @Update("update syc_card\n" +
            "        set actual_occupy = ifnull(actual_occupy,0) + #{occupy},\n" +
            "            actual_budget =  ifnull(actual_budget,0) - #{occupy}\n" +
            "        where project = #{project}\n" +
            "          and dr = 0")
    void updateOccupyByProject(@Param("project") String projectId, @Param("occupy") BigDecimal occupy);

}
